package com.xinghou.platform.server.api.bussiness.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.xinghou.platform.dao.main.DataConfigDAO;
import com.xinghou.platform.entity.resp.ShopjobResp;
import com.xinghou.platform.model.main.DataConfig;
import com.xinghou.platform.server.api.bussiness.ShopjobInfoBusinessService;

@Service("shopjobInfoService")
public class ShopjobInfoBusinessServiceImpl implements ShopjobInfoBusinessService {
	@Resource
	private DataConfigDAO dataConfigDAO;
	@Override
	public List<ShopjobResp> getShopjobList() throws DataAccessException {
		List<DataConfig> dataConfigs = new ArrayList<DataConfig>();
		dataConfigs = dataConfigDAO.getDataConfigList(2);
		
		ShopjobResp shopjobResp = null;
		List<ShopjobResp> shopjobRespList = new ArrayList<ShopjobResp>();
		for (int i = 0; i < dataConfigs.size(); i++) {
			shopjobResp = new ShopjobResp();
			shopjobResp.setJobid(dataConfigs.get(i).getTagId()+"");
			shopjobResp.setShopjob(dataConfigs.get(i).getName());
			shopjobRespList.add(shopjobResp);
		}
		
		return shopjobRespList;
	}

}
